package cc.rengu.redp.bizimpl.upmp.service;

import cc.rengu.redp.bizimpl.upmp.domain.BProdInfo;
import cc.rengu.redp.bizimpl.upmp.domain.UpmpOrganization;
import cc.rengu.redp.bizimpl.upmp.vo.OperationResult;
import cc.rengu.redp.bizimpl.upmp.vo.UpmpUserInfoVO;
import cc.rengu.redp.common.domain.QueryRequest;
import cc.rengu.redp.common.exception.RedpException;
import cc.rengu.redp.system.domain.User;
import com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleCreateTableStatement;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 刘玉亮.LL
 * @since 2021-06-10
 */
public interface IBProdInfoService extends IService<BProdInfo> {

    String getOprMenuId();

    String getOprMenuName();

    String getWebNextUrl();

    String getOprBtnNamePrefix();

    IPage<BProdInfo> findByPage(QueryRequest request, BProdInfo info);

    IPage<BProdInfo> findAddProdInfoSubByPage(QueryRequest request, BProdInfo info);

    IPage<BProdInfo> findChckProdInfoSubByPage(QueryRequest request, BProdInfo info);

    IPage<BProdInfo> findUpdProdInfoSubByPage(QueryRequest request, BProdInfo info);

    BProdInfo findProdByUK(String instId, String prodCode, String baseProdCode);

    BProdInfo findProdByDistinct(String instId, String prodCode);

    List<BProdInfo> findProdByCode(String instId, String prodCode);

    String getNewProdCode(String instId);

    Map<String,Object> getSubList(BProdInfo entity) throws RedpException;

    Map<String, Object> getEdit(BProdInfo entity) throws RedpException;

    //首页停用 启用标准产品
    @Transactional(value = "transactionManager")
    void changeStatus(BProdInfo bProdInfo);

    void saveFromSubListPageData(List<BProdInfo> datas, String optFlag)throws RedpException;

    OperationResult saveProdAndFollowersData(BProdInfo entity, UpmpUserInfoVO user, UpmpOrganization org, String optFlag);
}
